<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active {
            border: 1px solid red;
        }
    </style>
</head>

<body>
    <div id="app">
        <img v-bind:src="imgSrc" alt="">
        <br>
        <img v-bind:src="imgSrc" v-bind:title="imgtitle+'!!!!'" alt="">
        <br>
        <img v-bind:src="imgSrc" v-bind:class="{active:isActive}" @click="toggleActive">
    </div>

    <script src="./vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                imgSrc: "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png",
                imgtitle: "黑马",
                isActive: false
            },
            methods: {
                toggleActive: function() {
                    this.isActive = !this.isActive;
                }
            }

        })
    </script>

</body>

</html>